﻿using System;
using Decisions.HL7.Message;

namespace Decisions.HL7
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
    public class HL7SegmentGroupAttribute : Attribute
    {
        private HL7Version version;
        private int position;
        private HL7Repeat repeat;
        private HL7Required required;
        private string parentName;

        public HL7SegmentGroupAttribute(string name, HL7Version version, int position, HL7Repeat repeat, HL7Required required)
            : this(name, version, position, repeat, required, null)
        {

        }

        public HL7SegmentGroupAttribute(string name, HL7Version version, int position, HL7Repeat repeat, HL7Required required, string parentGroup)
        {
            this.version = version;
            this.position = position;
            this.repeat = repeat;
            this.required = required;
            this.parentName = parentGroup;
        }

        public int Position
        {
            get { return position; }
        }

        public HL7Version Version
        {
            get { return version; }
        }

        public HL7Repeat Repeat
        {
            get { return repeat; }
        }

        public HL7Required Required
        {
            get { return required; }
        }

        public string ParentName { get { return parentName; } }
    }
}